package demo

import "math"

/*
接口测试
*/
type Shape interface {
	area() float64
}

type Circle struct {
	X, Y, Radius float64
}

type Rectangle struct {
	Width, Height float64
}

func (circle Circle) area() float64 {
	return math.Pi * circle.Radius * circle.Radius
}

func (rectangle Rectangle) area() float64 {
	return rectangle.Width * rectangle.Height
}

func GetArea(shape Shape) float64 {
	return shape.area()
}
